from enum import Enum, unique


@unique
class SystemError(Enum):
    system = 'python3-系统报错'


# 返回码
class ErrorCode(object):
    OK = "HTTP/1.1 200 OK\r\n"
    METHOD_404 = "方法未定义404"
    METHOD_POST_BODY_NONE = "POST请求参数不能为空!"
    MYSQL_NONE = "MYSQL连接失败!"
    RABBIT_NONE = "rabbit连接失败!"
    INVALID_PARAMS_NONE = "检查参数失败!{0}不能传空值"


# 自定义异常类
class MyError(Exception):
    def __init__(self, *arg, **args):
        super(MyError, self).__init__(*arg)
